import { ApiPropertyOptional } from '@nestjs/swagger';
import { IsEmail, IsMobilePhone, IsOptional } from 'class-validator';

export class UserDto {
  @ApiPropertyOptional({ required: false, description: '手机号码' })
  @IsMobilePhone('zh-CN', {}, { message: '手机号码格式错误' })
  @IsOptional()
  readonly mobile?: string;

  @ApiPropertyOptional({ required: false, description: '邮箱' })
  @IsEmail({}, { message: '邮箱格式错误' })
  @IsOptional()
  readonly email?: string;

  @ApiPropertyOptional({ required: false, description: '用户头像' })
  @IsOptional()
  readonly avatar?: string;
}
